import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import tailwindcss from "@tailwindcss/vite";

// https://vite.dev/config/
export default defineConfig({
  plugins: [
    react({
      // 正确的 SWC 配置方式
      tsDecorators: true, // 如果需要装饰器支持
      jsc: {
        target: 'es5',
        parser: {
          syntax: 'typescript',
          tsx: true,
          decorators: true
        },
        transform: {
          react: {
            runtime: 'automatic'
          }
        }
      }
    }),
    tailwindcss(),
  ],
});
